<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    {% load static %}
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>天天生鲜-首页</title>
	<link rel="stylesheet" type="text/css" href="{% static "css/reset.css" %}">
	<link rel="stylesheet" type="text/css" href="{% static "css/main.css" %}">
	<script type="text/javascript" src="{% static "js/jquery-1.12.4.min.js" %}"></script>
	<script type="text/javascript" src="{% static "js/jquery-ui.min.js" %}"></script>
	<script type="text/javascript" src="{% static "js/slide.js" %}"></script>
</head>
<body>
	<div class="header_con">
		<div class="header">
			<div class="welcome fl">欢迎来到天天生鲜!</div>
			<div class="fr">
				<div class="login_info fl">
					欢迎您：<em>张 山</em>
				</div>
				<div class="login_btn fl">
					{% if request.user.id == None %}
					<a href="{% url "login" %}">登录</a>
					<span>|</span>
					<a href="{% url "register" %}">注册</a>
                    {% else %}
                    <a>{{ request.user.username }},欢迎登录</a>
                    <span>|</span>
                    <a href="{% url "user_logout" %}">退出登录</a>
                    {% endif %}
				</div>
				<div class="user_link fl">
					<span>|</span>
					<a href="{% url "user_center_info" %}">用户中心</a>
					<span>|</span>
					<a href="{% url "car" %}">我的购物车</a>
					<span>|</span>
					<a href="{% url "user_center_order" %}">我的订单</a>
				</div>
			</div>
		</div>		
	</div>

	<div class="search_bar clearfix">
		<a href="index.html" class="logo fl"><img src="{{ MEDIA_URL }}images/logo.png"></a>
		<div class="search_con fl">
			 <form method="get" action="{% url "search" %}">
              {% csrf_token %}
                 <input type="search" name="q" class="input_text fl" placeholder="搜索商品">
			     <input type="submit" class="input_btn fr" value="搜索">
{#              <input type="search" name="q" placeholder="搜索"  required >#}
{#              <button type="submit">搜索</button>#}
             </form>
		</div>
		<div class="guest_cart fr">
			<a href="{% url "shopping_index" %}" class="cart_name fl">我的购物车</a>
			<div class="goods_count fl" id="show_count">1</div>
		</div>
	</div>

	<div class="navbar_con">
		<div class="navbar">
			<h1 class="fl">全部商品分类</h1>
			<ul class="navlist fl">
				<li><a href="">首页</a></li>
				<li class="interval">|</li>
				<li><a href="">手机生鲜</a></li>
				<li class="interval">|</li>
				<li><a href="">抽奖</a></li>
			</ul>
		</div>
	</div>

	<div class="center_con clearfix">
		<ul class="subnav fl">
			<li><a href="#model01" class="fruit">新鲜水果</a></li>
			<li><a href="#model02" class="seafood">海鲜水产</a></li>
			<li><a href="#model03" class="meet">猪牛羊肉</a></li>
			<li><a href="#model04" class="egg">禽类蛋品</a></li>
			<li><a href="#model05" class="vegetables">新鲜蔬菜</a></li>
			<li><a href="#model06" class="ice">速冻食品</a></li>
		</ul>
		<div class="slide fl">
			<ul class="slide_pics">
				<li><img src="{{ MEDIA_URL }}images/slide.jpg" alt="幻灯片"></li>
				<li><img src="{{ MEDIA_URL }}images/slide02.jpg" alt="幻灯片"></li>
				<li><img src="{{ MEDIA_URL }}images/slide03.jpg" alt="幻灯片"></li>
				<li><img src="{{ MEDIA_URL }}images/slide04.jpg" alt="幻灯片"></li>
			</ul>
			<div class="prev"></div>
			<div class="next"></div>
			<ul class="points"></ul>
		</div>
		<div class="adv fl">
			<a href="#"><img src="{{ MEDIA_URL }}images/adv01.jpg"></a>
			<a href="#"><img src="{{ MEDIA_URL }}images/adv02.jpg"></a>
		</div>
	</div>

	<div class="list_model">
		<div class="list_title clearfix">
			<h3 class="fl" id="model01">新鲜水果</h3>
			<div class="subtitle fl">
				<span>|</span>
                {% for fruit in fruits|slice:"0:4" %}
				<a href="{% url "get_detail_html" fruit.id %}">{{ fruit.name }}</a>
				{% endfor %}
			</div>
			<a href="#" class="goods_more fr" id="fruit_more">查看更多 ></a>
		</div>

		<div class="goods_con clearfix">
			<div class="goods_banner fl"><img src="{{ MEDIA_URL }}images/banner01.jpg"></div>
			<ul class="goods_list fl">
                {% for fruit in fruits|slice:"0:4" %}
				<li>
					<h4><a href="{% url "get_detail_html" fruit.id %}">{{ fruit.name }}</a></h4>
					<a href="{% url "get_detail_html" fruit.id %}"><img src="{{ MEDIA_URL }}{{ fruit.images }}"></a>
					<div class="prize">¥ {{ fruit.price }}</div>
				</li>
                {% endfor %}
{#				<li>#}
{#					<h4><a href="#">葡萄</a></h4>#}
{#					<a href="#"><img src="{{ MEDIA_URL }}images/goods/goods002.jpg"></a>#}
{#					<div class="prize">¥ 5.50</div>#}
{#				</li>#}
{#				<li>#}
{#					<h4><a href="#">柠檬</a></h4>#}
{#					<a href="#"><img src="{{ MEDIA_URL }}images/goods/goods001.jpg"></a>#}
{#					<div class="prize">¥ 3.90</div>#}
{#				</li>#}
{#				<li>#}
{#					<h4><a href="#">奇异果</a></h4>#}
{#					<a href="#"><img src="{{ MEDIA_URL }}images/goods/goods012.jpg"></a>#}
{#					<div class="prize">¥ 25.80</div>#}
{#				</li>#}
			</ul>
		</div>
	</div>

	<div class="list_model">
		<div class="list_title clearfix">
			<h3 class="fl" id="model02">海鲜水产</h3>
			<div class="subtitle fl">
				<span>|</span>
				<a href="#">河虾</a>
				<a href="#">扇贝</a>				
			</div>
			<a href="#" class="goods_more fr">查看更多 ></a>
		</div>

		<div class="goods_con clearfix">
			<div class="goods_banner fl"><img src="{{ MEDIA_URL }}images/banner02.jpg"></div>
			<ul class="goods_list fl">
                {% for sea in seas|slice:"0:4" %}
				<li>
					<h4><a href="{% url "get_detail_html" sea.id %}">{{ sea.name }}</a></h4>
					<a href="{% url "get_detail_html" sea.id %}"><img src="{{ MEDIA_URL }}{{ sea.images }}"></a>
					<div class="prize">¥ {{ sea.price }}</div>
				</li>
                {% endfor %}
{#				<li>#}
{#					<h4><a href="#">扇贝</a></h4>#}
{#					<a href="#"><img src="{{ MEDIA_URL }}images/goods/goods019.jpg"></a>#}
{#					<div class="prize">¥ 46.00</div>#}
{#				</li>#}
{#				<li>#}
{#					<h4><a href="#">冷冻秋刀鱼</a></h4>#}
{#					<a href="#"><img src="{{ MEDIA_URL }}images/goods/goods020.jpg"></a>#}
{#					<div class="prize">¥ 19.00</div>#}
{#				</li>#}
{#				<li>#}
{#					<h4><a href="#">基围虾</a></h4>#}
{#					<a href="#"><img src="{{ MEDIA_URL }}images/goods/goods021.jpg"></a>#}
{#					<div class="prize">¥ 25.00</div>#}
{#				</li>#}
			</ul>
		</div>
	</div>

	<div class="list_model">
		<div class="list_title clearfix">
			<h3 class="fl" id="model03">猪牛羊肉</h3>
			<div class="subtitle fl">
				<span>|</span>
				<a href="#">鲜芒</a>
				<a href="#">加州提子</a>
				<a href="#">亚马逊牛油果</a>
			</div>
			<a href="#" class="goods_more fr">查看更多 ></a>
		</div>

		<div class="goods_con clearfix">
			<div class="goods_banner fl"><img src="{{ MEDIA_URL }}images/banner03.jpg"></div>
			<ul class="goods_list fl">
                {% for meat in meats|slice:"0:4" %}
				<li>
					<h4><a href="{% url "get_detail_html" meat.id %}">{{ meat.name }}</a></h4>
					<a href="{% url "get_detail_html" meat.id %}"><img src="{{ MEDIA_URL }}{{ meat.images }}"></a>
					<div class="prize">¥ {{ meat.price }}</div>
				</li>
                {% endfor %}
{#				<li>#}
{#					<h4><a href="#">维多利亚葡萄</a></h4>#}
{#					<a href="#"><img src="{{ MEDIA_URL }}images/goods.jpg"></a>#}
{#					<div class="prize">¥ 38.00</div>#}
{#				</li>#}
{#				<li>#}
{#					<h4><a href="#">维多利亚葡萄</a></h4>#}
{#					<a href="#"><img src="{{ MEDIA_URL }}images/goods.jpg"></a>#}
{#					<div class="prize">¥ 38.00</div>#}
{#				</li>#}
{#				<li>#}
{#					<h4><a href="#">维多利亚葡萄</a></h4>#}
{#					<a href="#"><img src="{{ MEDIA_URL }}images/goods.jpg"></a>#}
{#					<div class="prize">¥ 38.00</div>#}
{#				</li>#}
			</ul>
		</div>
	</div>

	<div class="list_model">
		<div class="list_title clearfix">
			<h3 class="fl" id="model04">禽类蛋品</h3>
			<div class="subtitle fl">
				<span>|</span>
				<a href="#">鲜芒</a>
				<a href="#">加州提子</a>
				<a href="#">亚马逊牛油果</a>
			</div>
			<a href="#" class="goods_more fr">查看更多 ></a>
		</div>

		<div class="goods_con clearfix">
			<div class="goods_banner fl"><img src="{{ MEDIA_URL }}images/banner04.jpg"></div>
			<ul class="goods_list fl">
                {% for egg in eggs|slice:"0:4" %}
				<li>
					<h4><a href="{% url "get_detail_html" egg.id %}">{{ egg.name }}</a></h4>
					<a href="{% url "get_detail_html" egg.id %}"><img src="{{ MEDIA_URL }}{{ egg.images }}"></a>
					<div class="prize">¥ {{ egg.price }}</div>
				</li>
                {% endfor %}
{#				<li>#}
{#					<h4><a href="#">维多利亚葡萄</a></h4>#}
{#					<a href="#"><img src="{{ MEDIA_URL }}images/goods.jpg"></a>#}
{#					<div class="prize">¥ 38.00</div>#}
{#				</li>#}
{#				<li>#}
{#					<h4><a href="#">维多利亚葡萄</a></h4>#}
{#					<a href="#"><img src="{{ MEDIA_URL }}images/goods.jpg"></a>#}
{#					<div class="prize">¥ 38.00</div>#}
{#				</li>#}
{#				<li>#}
{#					<h4><a href="#">维多利亚葡萄</a></h4>#}
{#					<a href="#"><img src="{{ MEDIA_URL }}images/goods.jpg"></a>#}
{#					<div class="prize">¥ 38.00</div>#}
{#				</li>#}
			</ul>
		</div>
	</div>

	<div class="list_model">
		<div class="list_title clearfix">
			<h3 class="fl" id="model05">新鲜蔬菜</h3>
			<div class="subtitle fl">
				<span>|</span>
				<a href="#">鲜芒</a>
				<a href="#">加州提子</a>
				<a href="#">亚马逊牛油果</a>
			</div>
			<a href="#" class="goods_more fr">查看更多 ></a>
		</div>

		<div class="goods_con clearfix">
			<div class="goods_banner fl"><img src="{{ MEDIA_URL }}images/banner05.jpg"></div>
			<ul class="goods_list fl">
                {% for vegetable in vegetables|slice:"0:4" %}
				<li>
					<h4><a href="{% url "get_detail_html" vegetable.id %}">{{ vegetable.name }}</a></h4>
					<a href="{% url "get_detail_html" vegetable.id %}"><img src="{{ MEDIA_URL }}{{ vegetable.images }}"></a>
					<div class="prize">¥ {{ vegetable.price }}</div>
				</li>
                {% endfor %}
{#				<li>#}
{#					<h4><a href="#">维多利亚葡萄</a></h4>#}
{#					<a href="#"><img src="{{ MEDIA_URL }}images/goods.jpg"></a>#}
{#					<div class="prize">¥ 38.00</div>#}
{#				</li>#}
{#				<li>#}
{#					<h4><a href="#">维多利亚葡萄</a></h4>#}
{#					<a href="#"><img src="{{ MEDIA_URL }}images/goods.jpg"></a>#}
{#					<div class="prize">¥ 38.00</div>#}
{#				</li>#}
{#				<li>#}
{#					<h4><a href="#">维多利亚葡萄</a></h4>#}
{#					<a href="#"><img src="{{ MEDIA_URL }}images/goods.jpg"></a>#}
{#					<div class="prize">¥ 38.00</div>#}
{#				</li>#}
			</ul>
		</div>
	</div>

	<div class="list_model">
		<div class="list_title clearfix">
			<h3 class="fl" id="model06">速冻食品</h3>
			<div class="subtitle fl">
				<span>|</span>
				<a href="{% url "get_detail_html" 1 %}">玉米</a>
				<a href="#">加州提子</a>
				<a href="#">亚马逊牛油果</a>
			</div>
			<a href="#" class="goods_more fr">查看更多 ></a>
		</div>

		<div class="goods_con clearfix">
			<div class="goods_banner fl"><img src="{{ MEDIA_URL }}images/banner06.jpg"></div>
			<ul class="goods_list fl">
                {% for quick in quicks|slice:"0:4" %}
				<li>
					<h4><a href="{% url "get_detail_html" quick.id %}">{{ quick.name }}</a></h4>
					<a href="{% url "get_detail_html" quick.id %}"><img src="{{ MEDIA_URL }}{{ quick.images }}"></a>
					<div class="prize">¥ {{ quick.price }}</div>
				</li>
                {% endfor %}
{#				<li>#}
{#					<h4><a href="#">维多利亚葡萄</a></h4>#}
{#					<a href="#"><img src="{{ MEDIA_URL }}images/goods.jpg"></a>#}
{#					<div class="prize">¥ 38.00</div>#}
{#				</li>#}
{#				<li>#}
{#					<h4><a href="#">维多利亚葡萄</a></h4>#}
{#					<a href="#"><img src="{{ MEDIA_URL }}images/goods.jpg"></a>#}
{#					<div class="prize">¥ 38.00</div>#}
{#				</li>#}
{#				<li>#}
{#					<h4><a href="#">维多利亚葡萄</a></h4>#}
{#					<a href="#"><img src="{{ MEDIA_URL }}images/goods.jpg"></a>#}
{#					<div class="prize">¥ 38.00</div>#}
{#				</li>#}
			</ul>
		</div>
	</div>

	<div class="footer">
		<div class="foot_link">
			<a href="#">关于我们</a>
			<span>|</span>
			<a href="#">联系我们</a>
			<span>|</span>
			<a href="#">招聘人才</a>
			<span>|</span>
			<a href="#">友情链接</a>		
		</div>
		<p>CopyRight © 2016 北京天天生鲜信息技术有限公司 All Rights Reserved</p>
		<p>电话：010-****888    京ICP备*******8号</p>
	</div>
	<script type="text/javascript" src="{% static "js/slideshow.js" %}"></script>
	<script type="text/javascript">
		BCSlideshow('focuspic');
		var oFruit = document.getElementById('fruit_more');
		var oShownum = document.getElementById('show_count');

		var hasorder = localStorage.getItem('order_finish');

		if(hasorder)
		{
			oShownum.innerHTML = '2';
		}

		oFruit.onclick = function(){
			window.location.href = 'list.html';
		}
	</script>
</body>
</html>